<?php

/**
 * Interaction filter form base class.
 *
 * @package    Web20
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseInteractionFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'identifier'         => new sfWidgetFormFilterInput(),
      'display_name'       => new sfWidgetFormFilterInput(),
      'service_name'       => new sfWidgetFormFilterInput(),
      'preferred_username' => new sfWidgetFormFilterInput(),
      'formated_name'      => new sfWidgetFormFilterInput(),
      'family_name'        => new sfWidgetFormFilterInput(),
      'given_name'         => new sfWidgetFormFilterInput(),
      'middle_name'        => new sfWidgetFormFilterInput(),
      'gender'             => new sfWidgetFormFilterInput(),
      'birthday'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'email'              => new sfWidgetFormFilterInput(),
      'verified_email'     => new sfWidgetFormFilterInput(),
      'url'                => new sfWidgetFormFilterInput(),
      'phone'              => new sfWidgetFormFilterInput(),
      'photo'              => new sfWidgetFormFilterInput(),
      'formated_address'   => new sfWidgetFormFilterInput(),
      'street_address'     => new sfWidgetFormFilterInput(),
      'locality'           => new sfWidgetFormFilterInput(),
      'region'             => new sfWidgetFormFilterInput(),
      'postal_code'        => new sfWidgetFormFilterInput(),
      'country'            => new sfWidgetFormFilterInput(),
      'user_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'add_empty' => true)),
      'created_at'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'identifier'         => new sfValidatorPass(array('required' => false)),
      'display_name'       => new sfValidatorPass(array('required' => false)),
      'service_name'       => new sfValidatorPass(array('required' => false)),
      'preferred_username' => new sfValidatorPass(array('required' => false)),
      'formated_name'      => new sfValidatorPass(array('required' => false)),
      'family_name'        => new sfValidatorPass(array('required' => false)),
      'given_name'         => new sfValidatorPass(array('required' => false)),
      'middle_name'        => new sfValidatorPass(array('required' => false)),
      'gender'             => new sfValidatorPass(array('required' => false)),
      'birthday'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'email'              => new sfValidatorPass(array('required' => false)),
      'verified_email'     => new sfValidatorPass(array('required' => false)),
      'url'                => new sfValidatorPass(array('required' => false)),
      'phone'              => new sfValidatorPass(array('required' => false)),
      'photo'              => new sfValidatorPass(array('required' => false)),
      'formated_address'   => new sfValidatorPass(array('required' => false)),
      'street_address'     => new sfValidatorPass(array('required' => false)),
      'locality'           => new sfValidatorPass(array('required' => false)),
      'region'             => new sfValidatorPass(array('required' => false)),
      'postal_code'        => new sfValidatorPass(array('required' => false)),
      'country'            => new sfValidatorPass(array('required' => false)),
      'user_id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('User'), 'column' => 'id')),
      'created_at'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('interaction_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Interaction';
  }

  public function getFields()
  {
    return array(
      'id'                 => 'Number',
      'identifier'         => 'Text',
      'display_name'       => 'Text',
      'service_name'       => 'Text',
      'preferred_username' => 'Text',
      'formated_name'      => 'Text',
      'family_name'        => 'Text',
      'given_name'         => 'Text',
      'middle_name'        => 'Text',
      'gender'             => 'Text',
      'birthday'           => 'Date',
      'email'              => 'Text',
      'verified_email'     => 'Text',
      'url'                => 'Text',
      'phone'              => 'Text',
      'photo'              => 'Text',
      'formated_address'   => 'Text',
      'street_address'     => 'Text',
      'locality'           => 'Text',
      'region'             => 'Text',
      'postal_code'        => 'Text',
      'country'            => 'Text',
      'user_id'            => 'ForeignKey',
      'created_at'         => 'Date',
      'updated_at'         => 'Date',
    );
  }
}
